<template>
  <div>
    <van-nav-bar title="我的收藏" left-text="返回" left-arrow @click-left="onClickLeft" />
    <PostItem :postData="item" v-for="item in postList" :key="item.id" />
  </div>
</template>

<script>
import PostItem from '../../components/PostItem'
import { Toast } from 'vant'

export default {
  components: {
    PostItem
  },
  data() {
    return {
      postList: []
    }
  },
  created() {
    this.$axios({
      url: '/user_star'
    }).then(res => {
      this.postList = res.data.data
    })
  },
  methods: {
    onClickLeft() {
      this.$router.back()
      Toast('返回')
    }
  }
}
</script>

<style lang="less" scoped></style>
